/**
 * 动态创建并提交表单
 * @param action 提交地址
 * @param data 表单数据对象
 */
export const submitForm = (action: string, data: Record<string, string>) => {
  const form = document.createElement('form')
  form.method = 'POST'
  form.action = action
  form.style.display = 'none'
  // 添加表单数据
  Object.entries(data).forEach(([name, value]) => {
	  console.log("data",data);
    const input = document.createElement('input')
    input.type = 'hidden'
    input.name = name
    input.value = value
    form.appendChild(input)
  })

  document.body.appendChild(form)
  form.submit()
  document.body.removeChild(form)
}